<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html lang="en">
<head>
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"/>
    <meta charset="utf-8"/>
    <title>安家桐城</title>
    <%@include file="/common/common-ico.jsp" %>
    <meta name="description" content="User login page"/>
    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0"/>
    <link rel="stylesheet" href="${allServerPath}static/layui/layui/css/layui.css"/>
    <%@include file="common/common-css.jsp" %>
</head>

<body class="login-layout">
<div class="main-container">
    <div class="main-content">
        <div class="row">
            <div class="col-sm-10 col-sm-offset-1">
                <div class="login-container">
                    <div class="center">
                        <h1>
                            <i class="ace-icon fa fa-leaf green"></i>
                            <span class="red">安家桐城</span>
                            <span class="white" id="id-text2">后台管理系统</span>
                        </h1>
                        <%--<h4 class="blue" id="id-company-text">&copy; 无厘学车</h4>--%>
                    </div>

                    <div class="space-6"></div>

                    <div class="position-relative">
                        <div id="login-box" class="login-box visible widget-box no-border">
                            <div class="widget-body">
                                <div class="widget-main">
                                    <h4 class="header blue lighter bigger">
                                        <i class="ace-icon fa fa-coffee green"></i>
                                        请输入您的信息
                                    </h4>

                                    <div class="space-6"></div>

                                    <form id="loginForm" action="${allServerPath}web/member/login.htmls" method="post">
                                        <fieldset>
                                            <label class="block clearfix">
														<span class="block input-icon input-icon-right">
															<input type="text" name="userName" class="form-control"
                                                                   placeholder="用户名"/>
															<i class="ace-icon fa fa-user"></i>
														</span>
                                            </label>

                                            <label class="block clearfix">
                                                <span class="block input-icon input-icon-right">
                                                    <input type="password" class="form-control"
                                                           placeholder="密码" name="password"/>
                                                    <i class="ace-icon fa fa-lock"></i>
                                                </span>
                                            </label>

                                            <div class="space"></div>

                                            <div class="clearfix">

                                                <button type="button" id="btnLogin"
                                                        class="width-35 pull-right btn btn-sm btn-primary">
                                                    <i class="ace-icon fa fa-key"></i>
                                                    <span class="bigger-110">登录</span>
                                                </button>
                                            </div>

                                            <div class="space-4"></div>
                                        </fieldset>
                                    </form>
                                </div>
                                <!-- /.widget-main -->

                                <div class="toolbar clearfix">
                                    <div><%--data-target="#forgot-box"--%>
                                        <a class="forgot-password-link" id="wjmm">
                                            <i class="ace-icon fa fa-arrow-left"></i>
                                            忘记密码
                                        </a>
                                    </div>

                                    <div>
                                        <a href="#" data-target="#signup-box" class="user-signup-link">
                                            注册
                                            <i class="ace-icon fa fa-arrow-right"></i>
                                        </a>
                                    </div>
                                </div>
                            </div>
                            <!-- /.widget-body -->
                        </div>
                        <!-- /.login-box -->
                        <!--忘记密码-->
                        <%--<div id="forgot-box" class="forgot-box widget-box no-border">
                            <div class="widget-body">
                                <div class="widget-main">
                                    <h4 class="header red lighter bigger">
                                        <i class="ace-icon fa fa-key"></i>
                                        重置密码
                                    </h4>

                                    <div class="space-6"></div>
                                    <p>
                                        邮箱
                                    </p>

                                    <form>
                                        <fieldset>
                                            <label class="block clearfix">
														<span class="block input-icon input-icon-right">
															<input type="email" class="form-control"
                                                                   placeholder="邮箱"/>
															<i class="ace-icon fa fa-envelope"></i>
														</span>
                                            </label>

                                            <div class="clearfix">
                                                <button type="button" class="width-35 pull-right btn btn-sm btn-danger">
                                                    <i class="ace-icon fa fa-lightbulb-o"></i>
                                                    <span class="bigger-110">发送邮件</span>
                                                </button>
                                            </div>
                                        </fieldset>
                                    </form>
                                </div>
                                <!-- /.widget-main -->

                                <div class="toolbar center">
                                    <a href="#" data-target="#login-box" class="back-to-login-link">
                                        返回登录
                                        <i class="ace-icon fa fa-arrow-right"></i>
                                    </a>
                                </div>
                            </div>
                            <!-- /.widget-body -->
                        </div>
                        <!-- /.forgot-box -->
                        --%>
                        <div id="signup-box" class="signup-box widget-box no-border">
                            <div class="widget-body">
                                <div class="widget-main">
                                    <h4 class="header green lighter bigger">
                                        <i class="ace-icon fa fa-users blue"></i>
                                        新用户注册
                                    </h4>

                                    <div class="space-6"></div>
                                    <p> 详细信息: </p>

                                    <form id="registerForm">
                                        <fieldset>
                                            <%--<label class="block clearfix">
														<span class="block input-icon input-icon-right">
															<input type="email" class="form-control"
                                                                   placeholder="邮箱" name="email"/>
															<i class="ace-icon fa fa-envelope"></i>
														</span>
                                            </label>--%>

                                            <label class="block clearfix">
														<span class="block input-icon input-icon-right">
															<input type="text" class="form-control"
                                                                   placeholder="用户名" name="userName"/>
															<i class="ace-icon fa fa-user"></i>
														</span>
                                            </label>

                                            <label class="block clearfix">
														<span class="block input-icon input-icon-right">
															<input type="password" class="form-control"
                                                                   placeholder="密码" name="password" id="pwd"/>
															<i class="ace-icon fa fa-lock"></i>
														</span>
                                            </label>

                                            <label class="block clearfix">
														<span class="block input-icon input-icon-right">
															<input type="password" class="form-control"
                                                                   placeholder="确认密码" name="repassword"
                                                                    />
															<i class="ace-icon fa fa-retweet"></i>
														</span>
                                            </label>

                                            <label class="block clearfix">
														<span class="block input-icon input-icon-right">
															<input type="text" class="form-control"
                                                                   placeholder="机构名称" name="company"/>
															<i class="ace-icon fa fa-lock"></i>
														</span>
                                            </label>

                                            <label class="block clearfix">
														<span class="block input-icon input-icon-right">
															<input type="text" class="form-control"
                                                                   placeholder="手机号" name="phone"/>
															<i class="ace-icon fa fa-retweet"></i>
														</span>
                                            </label>

                                            <%--<label class="block clearfix">--%>
                                            <%--<img id="shouquanBtn"--%>
                                            <%--src="${allServerPath}static/images/background/shouquan.png">--%>
                                            <%--</label>--%>

                                            <%--<label class="block">
                                                <input type="checkbox" class="ace"/>
														<span class="lbl">
															接受
															<a href="#">用户协议</a>
														</span>
                                            </label>--%>

                                            <div class="space-24"></div>

                                            <div class="clearfix">
                                                <button type="reset" class="width-30 pull-left btn btn-sm">
                                                    <i class="ace-icon fa fa-refresh"></i>
                                                    <span class="bigger-110">重置</span>
                                                </button>

                                                <button type="button"
                                                        class="width-65 pull-right btn btn-sm btn-success"
                                                        id="btnSubmit">
                                                    <span class="bigger-110">注册</span>

                                                    <i class="ace-icon fa fa-arrow-right icon-on-right"></i>
                                                </button>
                                            </div>
                                        </fieldset>
                                    </form>
                                </div>

                                <div class="toolbar center">
                                    <a href="#" data-target="#login-box" class="back-to-login-link">
                                        <i class="ace-icon fa fa-arrow-left"></i>
                                        返回登录
                                    </a>
                                </div>
                            </div>
                            <!-- /.widget-body -->
                        </div>
                        <!-- /.signup-box -->
                    </div>
                    <!-- /.position-relative -->

                    <div class="navbar-fixed-top align-right">
                        <br/>
                        &nbsp;
                        <a id="btn-login-dark" href="#">Dark</a>
                        &nbsp;
                        <span class="blue">/</span>
                        &nbsp;
                        <a id="btn-login-blur" href="#">Blur</a>
                        &nbsp;
                        <span class="blue">/</span>
                        &nbsp;
                        <a id="btn-login-light" href="#">Light</a>
                        &nbsp; &nbsp; &nbsp;
                    </div>
                </div>
            </div>
            <!-- /.col -->
        </div>
        <!-- /.row -->
    </div>
    <!-- /.main-content -->
</div>
<!-- /.main-container -->

<!-- basic scripts -->

<!--[if !IE]> -->
<script src="${allServerPath}static/js/jquery-2.1.4.min.js"></script>

<!-- <![endif]-->

<!--[if IE]>
<script src="${allServerPath}static/js/jquery-1.11.3.min.js"></script>
<![endif]-->
<script type="text/javascript">
    if ('ontouchstart' in document.documentElement) document.write("<script src='${allServerPath}static/js/jquery.mobile.custom.min.js'>" + "<" + "/script>");
</script>
<script src="${allServerPath}static/js/common.js"></script>
<!-- inline scripts related to this page -->
<script src="${allServerPath}static/layui/layui/layui.js"></script>
<script type="text/javascript">
    layui.use(['layer'], function () {
        var layer = layui.layer;
        jQuery(function ($) {
            $(document).on('click', '.toolbar a[data-target]', function (e) {
                e.preventDefault();
                var target = $(this).data('target');
                $('.widget-box.visible').removeClass('visible');//hide others
                $(target).addClass('visible');//show target
            });


//            $("#shouquanBtn").click(function () {
//                window.location.href = "https://mp.weixin.qq.com/cgi-bin/componentloginpage?component_appid=wx63aeaca36da3cc1d&pre_auth_code=preauthcode@@@Fe01g5mrjoxRJrxbCa5BlnRsXiYtNDbMXfzJN_lr5h364kDlvONVLyZUoW7bKKE6&redirect_uri=http%3A%2F%2Fwww.wuminginfo.com%2Fdrivermanage%2Flogin.jsp";
//            });

            $("#btnLogin").click(function () {
                var userName = $("input[name = 'userName']").val();
                if (userName == "") {
                    layer.alert('用户名不能为空.');
                    return false;
                }
                var password = $("input[name = 'password']").val();
                if (password == "") {
                    layer.alert('密码不能为空.');
                    return false;
                }
                $("#loginForm").submit();
            });

            $("#btnSubmit").click(function () {
                var userName = $("#registerForm input[name = 'userName']").val();
                if (userName == "") {
                    layer.alert('用户名不能为空.');
                    return false;
                }
                var password = $("#registerForm input[name = 'password']").val();
                if (password == "") {
                    layer.alert('密码不能为空.');
                    return false;
                }
                var repassword = $("#registerForm input[name = 'repassword']").val();
                if (repassword == "") {
                    layer.alert('确认密码不能为空.');
                    return false;
                }
                var company = $("#registerForm input[name = 'company']").val();
                if (company == "") {
                    layer.alert('机构名称不能为空.');
                    return false;
                }

                var phone = $("#registerForm input[name = 'phone']").val();
                if (phone == "") {
                    layer.alert('手机号不能为空.');
                    return false;
                }
                $.ajax({
                    cache: true,
                    type: "POST",
                    url: HuiqianUtil.getWebRootPath() + "/web/member/save.htmls",
                    data: $('#registerForm').serialize(),// 你的formid
                    async: false,
                    dataType: "JSON",
                    error: function (request) {
                        alert("Connection error");
                    },
                    success: function (data) {
//                    alert(data.data);
                        layer.open({
                            title: '温馨提示',
                            content: data.data,
                            btn: ['确定'],
                            btn1: function (index, layero) {
                                window.location.href = HuiqianUtil.getWebRootPath() + "/login.jsp";
                            }
                        });

                    }
                });
            });
            $("input[name='repassword']").blur(function () {
                if ($("#pwd").val() != $("input[name='repassword']").val()) {
                    alert('两次输入密码不一致，请重新输入。。。');
                }
            });

            $("body").keydown(function () {
                if (event.keyCode == "13") {//keyCode=13是回车键
                    $('#btnLogin').click();
                }
                ;
            });

            $("#wjmm").click(function () {
                layer.open({


                    type: 1
                    ,
                    title: false //不显示标题栏
                    ,
                    closeBtn: false
                    ,
                    shade: 0.3
                    ,
                    id: 'LAY_layuipro' //设定一个id，防止重复弹出
                    ,
                    btn: ['确定', '取消']
                    ,
                    btnAlign: 'c'
                    ,
                    moveType: 1 //拖拽模式，0或者1
                    ,
                    content: '<div style="padding: 50px; line-height: 12px; background-color: #393D49; color: #fff; font-weight: 300;"><br>忘记密码或修改密码请联系系统管理员哟^_^<br><br>点击<span color:#fff>确定按钮</span>即可与系统管理员进行即时聊天哟^_^<br><br></div>'
                    ,
                    success: function (layero) {
                        var btn = layero.find('.layui-layer-btn');
                        btn.find('.layui-layer-btn0').attr({
                            href: 'tencent://message/?uin=401944133&Site=http://vps.shuidazhe.com&Menu=yes'
                            , target: '_blank'
                        });
                    }


                });
            });

            //you don't need this, just used for changing background
            jQuery(function ($) {
                $('#btn-login-dark').on('click', function (e) {
                    $('body').attr('class', 'login-layout');
                    $('#id-text2').attr('class', 'white');
                    $('#id-company-text').attr('class', 'blue');

                    e.preventDefault();
                });
                $('#btn-login-light').on('click', function (e) {
                    $('body').attr('class', 'login-layout light-login');
                    $('#id-text2').attr('class', 'grey');
                    $('#id-company-text').attr('class', 'blue');

                    e.preventDefault();
                });
                $('#btn-login-blur').on('click', function (e) {
                    $('body').attr('class', 'login-layout blur-login');
                    $('#id-text2').attr('class', 'white');
                    $('#id-company-text').attr('class', 'light-blue');

                    e.preventDefault();
                });

            });
        });
    });
</script>
</body>
</html>
